<template>
  <div class="div-search-action">
    <!--当前生产的对话框-->
    <el-dialog :show-close=false
               :close-on-press-escape=false
               :close-on-click-modal=false
               :title="$getTextByLangKey('编辑当前生产信息')"
               @open="openNowDialog"
               :visible="nowProduce_dialogVisible"
               width="72%">
      <div style="display:flex;align-items: center;">
        <div style="flex: 1;">
          <el-form class="el-form-left" label-position="right" size="small" label-width="130px"
                   :model="dialog_nowProduce">
            <el-form-item
              :label="$getTextByLangKey('机型')+'：'"
            >
              <el-input v-model="dialog_nowProduce.machineType"></el-input>
            </el-form-item>

            <el-form-item
              :label="$getTextByLangKey('工单号')+'：'"
            >
              <el-input v-model="dialog_nowProduce.workOrder"></el-input>
            </el-form-item>

            <el-form-item
              :label="$getTextByLangKey('订单号')+'：'"
            >
              <el-input v-model="dialog_nowProduce.clientOrder"></el-input>
            </el-form-item>

            <el-form-item
              :label="$getTextByLangKey('计划数量')+'：'"
            >
              <el-input v-model="dialog_nowProduce.plannedQuantity"></el-input>
            </el-form-item>

            <el-form-item
              :label="$getTextByLangKey('预计完成时间')+'：'"
            >
              <!--<el-date-picker :value="dialog_nowProduce.estimateFinishTime" @input="updatenowProduceEstimateFinishTime" type="datetime" placeholder="请选择预计完成时间"></el-date-picker>-->
              <el-input v-model="dialog_nowProduce.estimateFinishTime"></el-input>
            </el-form-item>

            <el-form-item :label="$getTextByLangKey('工艺')+'：'">
              <el-input v-model="dialog_nowProduce.technology"></el-input>
            </el-form-item>

            <el-form-item :label="$getTextByLangKey('AB面')+'：'">
              <el-input v-model="dialog_nowProduce.surface"></el-input>
            </el-form-item>
          </el-form>
        </div>


        <div style="flex: 1;">
          <el-form class="el-form-left" label-position="right" size="small" label-width="130px"
                   :model="dialog_nowProduce">
            <el-form-item :label="$getTextByLangKey('pcba生产速度/s')+'：'">
              <el-input v-model="dialog_nowProduce.pcbaSpeed"></el-input>
            </el-form-item>
            <el-form-item :label="$getTextByLangKey('pcba焊点数')+'：'">
              <el-input v-model="dialog_nowProduce.pcbaSpots"></el-input>
            </el-form-item>
            <el-form-item :label="$getTextByLangKey('pcba编码前缀')+'：'">
              <el-input v-model="dialog_nowProduce.pcbaCodePrefix" placeholder=""></el-input>
            </el-form-item>
            <el-form-item :label="$getTextByLangKey('pcba编码起始值')+'：'">
              <el-input v-model="dialog_nowProduce.pcbaStart"></el-input>
            </el-form-item>
            <el-form-item :label="$getTextByLangKey('pcba编码终止值')+'：'">
              <el-input v-model="dialog_nowProduce.pcbaEnd"></el-input>
            </el-form-item>
            <el-form-item :label="$getTextByLangKey('pcba编码后缀')+'：'">
              <el-input v-model="dialog_nowProduce.pcbaCodeSuffix" placeholder="逗号分隔，如1,2"></el-input>
            </el-form-item>
          </el-form>
        </div>

        <div style="flex: 1;">
          <el-form class="el-form-left" label-position="right" size="small" label-width="110px"
                   :model="dialog_nowProduce">

            <el-form-item label="">
              <div style="text-align: center;font-weight: bold;font-size: 16px;">{{$getTextByLangKey('白班人员')}}</div>
            </el-form-item>

            <el-form-item
              :label="$getTextByLangKey('工程部')+'：'"
            >
              <el-input v-model="dialog_nowProduce.engineer"></el-input>
            </el-form-item>
            <el-form-item
              label=""
            >
              <el-upload
                class="avatar-uploader"
                action="/api/now/produce/uploadWorkerImg"
                accept=".jpg, .png"
                name="img"
                :data="{lineName:dialog_nowProduce.lineName,post:'engineer'}"
                :show-file-list="false"
                :before-upload="beforeAvatarUpload"
                :on-success="successAvatarUpload"
              >
                <img v-if="dialog_nowProduce.engineerImg" :src="dialog_nowProduce.engineerImg+'&t='+new Date().getTime()" class="avatar" mode="aspectFill">
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </el-form-item>

            <el-form-item
              :label="$getTextByLangKey('生产部')+'：'"
            >
              <el-input v-model="dialog_nowProduce.operator"></el-input>
            </el-form-item>
            <el-form-item
              label=""
            >
              <el-upload
                class="avatar-uploader"
                action="/api/now/produce/uploadWorkerImg"
                accept=".jpg, .png"
                name="img"
                :data="{lineName:dialog_nowProduce.lineName,post:'operator'}"
                :show-file-list="false"
                :before-upload="beforeAvatarUpload"
                :on-success="successAvatarUpload">
                <img v-if="dialog_nowProduce.operatorImg" :src="dialog_nowProduce.operatorImg+'&t='+new Date().getTime()" class="avatar" mode="aspectFill">
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </el-form-item>

            <el-form-item
              :label="$getTextByLangKey('品质部')+'：'"
            >
              <el-input v-model="dialog_nowProduce.qc"></el-input>
            </el-form-item>
            <el-form-item
              label=""
            >
              <el-upload
                class="avatar-uploader"
                action="/api/now/produce/uploadWorkerImg"
                accept=".jpg, .png"
                name="img"
                :data="{lineName:dialog_nowProduce.lineName,post:'qc'}"
                :show-file-list="false"
                :before-upload="beforeAvatarUpload"
                :on-success="successAvatarUpload">
                <img v-if="dialog_nowProduce.qcImg" :src="dialog_nowProduce.qcImg+'&t='+new Date().getTime()" class="avatar" mode="aspectFill">
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </el-form-item>

          </el-form>
        </div>

        <div style="flex: 1;">
          <el-form class="el-form-left" label-position="right" size="small" label-width="110px"
                   :model="dialog_nowProduce">

            <el-form-item label="">
              <div style="text-align: center;font-weight: bold;font-size: 16px;">{{$getTextByLangKey('夜班人员')}}</div>
            </el-form-item>


            <el-form-item
              :label="$getTextByLangKey('工程部')+'：'"
            >
              <el-input v-model="dialog_nowProduce.nightEngineer"></el-input>
            </el-form-item>
            <el-form-item
              label=""
            >
              <el-upload
                class="avatar-uploader"
                action="/api/now/produce/uploadWorkerImg"
                accept=".jpg, .png"
                name="img"
                :data="{lineName:dialog_nowProduce.lineName,post:'nightEngineer'}"
                :show-file-list="false"
                :before-upload="beforeAvatarUpload"
                :on-success="successAvatarUpload">
                <img v-if="dialog_nowProduce.nightEngineerImg" :src="dialog_nowProduce.nightEngineerImg+'&t='+new Date().getTime()" class="avatar" mode="aspectFill">
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </el-form-item>

            <el-form-item
              :label="$getTextByLangKey('生产部')+'：'"
            >
              <el-input v-model="dialog_nowProduce.nightOperator"></el-input>
            </el-form-item>
            <el-form-item
              label=""
            >
              <el-upload
                class="avatar-uploader"
                action="/api/now/produce/uploadWorkerImg"
                accept=".jpg, .png"
                name="img"
                :data="{lineName:dialog_nowProduce.lineName,post:'nightOperator'}"
                :show-file-list="false"
                :before-upload="beforeAvatarUpload"
                :on-success="successAvatarUpload">
                <img v-if="dialog_nowProduce.nightOperatorImg" :src="dialog_nowProduce.nightOperatorImg+'&t='+new Date().getTime()" class="avatar" mode="aspectFill">
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </el-form-item>

            <el-form-item
              :label="$getTextByLangKey('品质部')+'：'"
            >
              <el-input v-model="dialog_nowProduce.nightQc"></el-input>
            </el-form-item>
            <el-form-item
              label=""
            >
              <el-upload
                class="avatar-uploader"
                action="/api/now/produce/uploadWorkerImg"
                accept=".jpg, .png"
                name="img"
                :data="{lineName:dialog_nowProduce.lineName,post:'nightQc'}"
                :show-file-list="false"
                :before-upload="beforeAvatarUpload"
                :on-success="successAvatarUpload">
                <img v-if="dialog_nowProduce.nightQcImg" :src="dialog_nowProduce.nightQcImg+'&t='+new Date().getTime()" class="avatar" mode="aspectFill">
                <i v-else class="el-icon-plus avatar-uploader-icon"></i>
              </el-upload>
            </el-form-item>
          </el-form>
        </div>
        <!--<el-col :span="8">-->
        <!--<el-form class="el-form-right" label-position="left" label-width="82px" :model="dialog_nowProduce">-->


        <!---->
        <!--</el-form>-->
        <!--</el-col>-->
      </div>

      <span slot="footer" class="dialog-footer">
        <el-button @click="cancelDialog" size="small">{{$getTextByLangKey('取消')}}</el-button>
        <el-button type="primary" @click="confrimNowDialog" size="small">{{$getTextByLangKey('确定')}}</el-button>
      </span>
    </el-dialog>


    <!--待生产的对话框-->
    <el-dialog :show-close=false
               :close-on-press-escape=false
               :close-on-click-modal=false
               :title="$getTextByLangKey('编辑待生产信息')"
               @open="openWaitDialog"
               :visible="waitProduce_dialogVisible"
               width="60%">
      <el-row>
        <el-col :span="6">
          <el-form class="el-form-left" label-position="right" size="small" label-width="110px"
                   :model="dialog_waitProduce">
            <el-form-item
              :label="$getTextByLangKey('机型1')+'：'"
            >
              <el-input v-model="dialog_waitProduce.machineType"></el-input>
            </el-form-item>

          </el-form>
        </el-col>

        <el-col :span="6">
          <el-form class="el-form-left" label-position="right" size="small" label-width="110px"
                   :model="dialog_waitProduce">
            <el-form-item label="计划数量：">
              <el-input v-model="dialog_waitProduce.plannedQuantity"></el-input>
            </el-form-item>

          </el-form>
        </el-col>

        <el-col :span="8">
          <el-form class="el-form-left" label-position="right" size="small" label-width="130px"
                   :model="dialog_waitProduce">

            <el-form-item
              :label="$getTextByLangKey('预计开始时间')+'：'"
            >
              <el-input v-model="dialog_waitProduce.startTime"></el-input>
            </el-form-item>
          </el-form>
        </el-col>

      </el-row>

      <el-row>
        <el-col :span="6">
          <el-form class="el-form-left" label-position="right" size="small" label-width="110px"
                   :model="dialog_waitProduce">
            <el-form-item
              :label="$getTextByLangKey('机型2')+'：'"
            >
              <el-input v-model="dialog_waitProduce.machineType2"></el-input>
            </el-form-item>

          </el-form>
        </el-col>

        <el-col :span="6">
          <el-form class="el-form-left" label-position="right" size="small" label-width="110px"
                   :model="dialog_waitProduce">
            <el-form-item label="计划数量：">
              <el-input v-model="dialog_waitProduce.plannedQuantity2"></el-input>
            </el-form-item>

          </el-form>
        </el-col>

        <el-col :span="8">
          <el-form class="el-form-left" label-position="right" size="small" label-width="130px"
                   :model="dialog_waitProduce">

            <el-form-item
              :label="$getTextByLangKey('预计开始时间')+'：'"
            >
              <el-input v-model="dialog_waitProduce.startTime2"></el-input>
            </el-form-item>
          </el-form>
        </el-col>

      </el-row>

      <el-row>
        <el-col :span="6">
          <el-form class="el-form-left" label-position="right" size="small" label-width="110px"
                   :model="dialog_waitProduce">
            <el-form-item
              :label="$getTextByLangKey('机型3')+'：'"
            >
              <el-input v-model="dialog_waitProduce.machineType3"></el-input>
            </el-form-item>

          </el-form>
        </el-col>

        <el-col :span="6">
          <el-form class="el-form-left" label-position="right" size="small" label-width="110px"
                   :model="dialog_waitProduce">
            <el-form-item label="计划数量：">
              <el-input v-model="dialog_waitProduce.plannedQuantity3"></el-input>
            </el-form-item>

          </el-form>
        </el-col>

        <el-col :span="8">
          <el-form class="el-form-left" label-position="right" size="small" label-width="130px"
                   :model="dialog_waitProduce">

            <el-form-item
              :label="$getTextByLangKey('预计开始时间')+'：'"
            >
              <el-input v-model="dialog_waitProduce.startTime3"></el-input>
            </el-form-item>
          </el-form>
        </el-col>

      </el-row>

      <span slot="footer" class="dialog-footer">
        <el-button @click="cancelDialog" size="small">{{$getTextByLangKey('取消')}}</el-button>
        <el-button type="primary" @click="confrimWaitDialog" size="small">{{$getTextByLangKey('确定')}}</el-button>
      </span>
    </el-dialog>

    <div class="action-wrapper " :class="isTv?'action-wrapper-tv':''">

      <div class="action-content" :class="isTv?'action-content-tv':''" v-if="showCurrent||isTv">
        <div class="action-title">
          <span class="info-title" @click="nowProduce_dialogVisible = true">{{$getTextByLangKey('当前生产信息')}}</span>
          <!--<i class="icon el-icon-edit-outline"></i>-->
          <div class="center-div"></div>
          <el-button size="mini" @click="nowProduce_dialogVisible = true" v-if="!isTv" :disabled="!isAdmin">{{$getTextByLangKey('编辑当前生产信息')}}</el-button>
          <el-button size="mini" @click="showCurrent = false" v-if="!isTv">{{$getTextByLangKey('切换到待生产信息')}}</el-button>
        </div>

        <div class="line-data-wrapper">
          <div class="line-data">
            <div class="simple">
              <span>{{$getTextByLangKey('产线')}}：</span>
              <span>{{nowProduce.lineName}}</span>
            </div>

            <div class="simple">
              <span>{{$getTextByLangKey('机型')}}：</span>
              <span>{{nowProduce.machineType}}</span>
            </div>

            <div class="simple">
              <span>{{$getTextByLangKey('工单号')}}：</span>
              <span>{{nowProduce.workOrder}}</span>
            </div>

            <div class="simple">
              <span>{{$getTextByLangKey('计划数量')}}：</span>
              <span>{{nowProduce.plannedQuantity}}</span>
            </div>

          </div>

          <div class="line-data">

            <div class="simple">
              <span>{{$getTextByLangKey('已生产数')}}：</span>
              <span>{{nowProduce.hasProducedQuantity}}</span>
            </div>

            <div class="simple">
              <span>{{$getTextByLangKey('开始时间')}}：</span>
              <span>{{nowProduce.startTime}}</span>
            </div>

            <div class="simple">
              <span>{{$getTextByLangKey('程序名称')}}：</span>
              <span>{{nowProduce.programName}}</span>
            </div>

            <div class="simple">
              <span>{{$getTextByLangKey('贴装时间')}}：</span>
              <span>{{nowProduce.duration}}</span>
            </div>

          </div>

          <div class="line-data">

            <div class="simple">
              <span>{{$getTextByLangKey('工程部')}}：</span>
              <span>{{nowProduce.engineer}}</span>
            </div>


            <div class="simple">
              <span>生产部：</span>
              <span>{{nowProduce.operator}}</span>
            </div>

            <div class="simple">
              <span>{{$getTextByLangKey('品质部')}}：</span>
              <span>{{nowProduce.qc}}</span>
            </div>

            <div class="simple">
<!--              <span>{{$getTextByLangKey('AOI工程师')}}：</span>-->
<!--              <span>{{nowProduce.engineer}}</span>-->
            </div>







          </div>

<!--          <div class="line-data">-->


<!--            <div class="simple">-->
<!--              <span>{{$getTextByLangKey('设备工程师')}}：</span>-->
<!--              <span>{{nowProduce.technician}}</span>-->
<!--            </div>-->

<!--            <div class="simple">-->
<!--              <span>{{$getTextByLangKey('操作员')}}：</span>-->
<!--              <span>{{nowProduce.operator}}</span>-->
<!--            </div>-->



<!--            <div class="simple">-->
<!--              <span>IPQC：</span>-->
<!--              <span>{{nowProduce.ipqc}}</span>-->
<!--            </div>-->
<!--            <div class="simple">-->
<!--              <span>AOI测试员：</span>-->
<!--              <span>{{nowProduce.pe}}</span>-->
<!--            </div>-->




<!--          </div>-->
        </div>
      </div>

      <div class="action-content" :class="isTv?'action-content-tv':''" v-if="!showCurrent||isTv">
        <div class="action-title">
          <span class="info-title" @click="waitProduce_dialogVisible = true">{{$getTextByLangKey('待生产信息')}}</span>
          <!--<i class="icon el-icon-edit-outline"></i>-->
          <div class="center-div"></div>
          <el-button size="mini" @click="waitProduce_dialogVisible = true" v-if="!isTv" :disabled="!isAdmin">{{$getTextByLangKey('编辑待生产信息')}}</el-button>
          <el-button size="mini" @click="showCurrent = true" v-if="!isTv">{{$getTextByLangKey('切换到当前生产信息')}}</el-button>
        </div>

        <div class="line-data-wrapper">

          <div class="line-data">
            <div class="simple">
              <span>{{$getTextByLangKey('机型1')}}：</span>
              <span>{{waitProduce.machineType}}</span>
            </div>
          </div>

          <div class="line-data">
            <div class="simple">
              <span>{{$getTextByLangKey('计划数量')}}：</span>
              <span>{{waitProduce.plannedQuantity}}</span>
            </div>

          </div>

          <div class="line-data">

            <div class="simple">
              <span>{{$getTextByLangKey('开始时间')}}：</span>
              <span>{{waitProduce.startTime}}</span>
            </div>

          </div>

          <div class="line-data">
          </div>
        </div>

        <div class="line-data-wrapper">
          <div class="line-data">
            <div class="simple">
              <span>{{$getTextByLangKey('机型2')}}：</span>
              <span>{{waitProduce.machineType2}}</span>
            </div>
          </div>

          <div class="line-data">
            <div class="simple">
              <span>{{$getTextByLangKey('计划数量')}}：</span>
              <span>{{waitProduce.plannedQuantity2}}</span>
            </div>

          </div>

          <div class="line-data">
            <div class="simple">
              <span>{{$getTextByLangKey('开始时间')}}：</span>
              <span>{{waitProduce.startTime2}}</span>
            </div>
          </div>

          <div class="line-data">
          </div>
        </div>
        <div class="line-data-wrapper">
          <div class="line-data">
            <div class="simple">
              <span>{{$getTextByLangKey('机型3')}}：</span>
              <span>{{waitProduce.machineType3}}</span>
            </div>
          </div>

          <div class="line-data">
            <div class="simple">
              <span>{{$getTextByLangKey('计划数量')}}：</span>
              <span>{{waitProduce.plannedQuantity3}}</span>
            </div>

          </div>

          <div class="line-data">
            <div class="simple">
              <span>{{$getTextByLangKey('开始时间')}}：</span>
              <span>{{waitProduce.startTime3}}</span>
            </div>
          </div>

          <div class="line-data">
          </div>
        </div>
      </div>

    </div>

    <div class="line"></div>
  </div>
</template>
<script>

  import util from '@/common/js/util'
  import request from '@/common/js/request'

  export default {
    name: "search-action-componet",
    props: ['nowProduce', 'waitProduce'],
    data() {
      return {
        isTv: false,
        title: this.$getTextByLangKey('当前生产信息'),
        deviceChoosePlaceholder: this.$getTextByLangKey('请选择设备'),
        nowProduce_dialogVisible: false,
        waitProduce_dialogVisible: false,

        dialog_nowProduce: {},
        dialog_waitProduce: {},


        isAdmin : localStorage.getItem("username") === 'admin',

        showCurrent: true,
//        excelForm: {
//          lineName: '',
//          programName: '',
//          orderNum: '',
//          orderCount: '',
//          customName: '',
//          productName: '',
//        },
      }
    },
    created: function () {

      let path = this.$route.path
      if (path.startsWith('/lineStatus')) {
        this.isTv = true
      }
//      this.excelForm.lineName = this.chanxian
//      this.excelForm.programName = this.program
    },
    methods: {
      beforeAvatarUpload:function(file){
        const isLt2M = file.size / 1024 / 1024 < 2;
        if (!isLt2M) {
          this.$message.error('上传图片大小不能超过 2MB!');
        }
        return isLt2M;
      },
      successAvatarUpload:function(response, file, fileList){

        if(response.code == 200){

          const params_post = response.data.post
          const params_lineName = response.data.lineName
          const params_path = response.data.img
          this.dialog_nowProduce[params_post+'Img'] = params_path
        }
      },


      updateDeviceChoose: function (val) {
        this.$emit('updateValue', 'updateDeviceChoose', val)
      },
      updateUserChoose: function (val) {
        this.$emit('updateValue', 'updateUserChoose', val)
      },
      updateStandChoose: function (val) {
        this.$emit('updateValue', 'updateStandChoose', val)
      },
      updateBeginDate: function (val) {
        this.$emit('updateValue', 'updateBeginDate', val)
      },
      updateOverDate: function (val) {
        this.$emit('updateValue', 'updateOverDate', val)
      },
      searchData: function () {
        this.$emit("searchData")
      },
      creatDialog: function () {
        this.nowProduce_dialogVisible = true;
        this.waitProduce_dialogVisible = true;
      },
      cancelDialog: function () {
        this.nowProduce_dialogVisible = false;
        this.waitProduce_dialogVisible = false;
      },
      confrimWaitDialog: function () {

//        console.log(this.dialog_waitProduce)
        console.log('this.dialog_waitProduce',this.dialog_waitProduce)
        let dialog_waitProduce = util.deepCopy(this.dialog_waitProduce)
//        dialog_waitProduce.estimateFinishTime = new Date(dialog_waitProduce.estimateFinishTime).getTime()

        // dialog_waitProduce.startTime = !isNaN(new Date(dialog_waitProduce.startTime).getTime())?new Date(dialog_waitProduce.startTime).getTime():''
        // dialog_waitProduce.startTime2 = !isNaN(new Date(dialog_waitProduce.startTime2).getTime())?new Date(dialog_waitProduce.startTime2).getTime():''
        // dialog_waitProduce.startTime3 = !isNaN(new Date(dialog_waitProduce.startTime3).getTime())?new Date(dialog_waitProduce.startTime3).getTime():''
//        dialog_waitProduce.duration = !isNaN(new Date(dialog_waitProduce.duration).getTime())?new Date(dialog_waitProduce.duration).getTime():''
        dialog_waitProduce.finalTime = !isNaN(new Date(dialog_waitProduce.finalTime).getTime())?new Date(dialog_waitProduce.finalTime).getTime():''
        dialog_waitProduce.estimateFinishTime = new Date(dialog_waitProduce.estimateFinishTime).getTime()//这个会做修改
        dialog_waitProduce.estimateStartTime =  !isNaN(new Date(dialog_waitProduce.estimateStartTime).getTime())?new Date(dialog_waitProduce.estimateStartTime).getTime():''


//        console.log(dialog_waitProduce)
//         if (!dialog_waitProduce.startTime||dialog_waitProduce.startTime<0||!dialog_waitProduce.startTime2||dialog_waitProduce.startTime2<0||!dialog_waitProduce.startTime3||dialog_waitProduce.startTime3<0) {
//           util.showErrorToast(this.$getTextByLangKey('日期格式有误，请重新输入'))
//         } else {
//           request.requestSaveWaitProduce(dialog_waitProduce, res => {
//             util.showSuccessToast(this.$getTextByLangKey('修改成功'))
//             this.$emit("updateWaitProduce", res.data.data.list[0])
//           })
//           this.waitProduce_dialogVisible = false;
//         }

        request.requestSaveWaitProduce(dialog_waitProduce, res => {
          util.showSuccessToast(this.$getTextByLangKey('修改成功'))
          this.$emit("updateWaitProduce", res.data.data.list[0])
        })
        this.waitProduce_dialogVisible = false;

      },

      confrimNowDialog: function () {
        let dialog_nowProduce = util.deepCopy(this.dialog_nowProduce)
//        dialog_nowProduce.estimateFinishTime = new Date(dialog_nowProduce.estimateFinishTime).getTime()

        dialog_nowProduce.startTime = !isNaN(new Date(dialog_nowProduce.startTime).getTime())?new Date(dialog_nowProduce.startTime).getTime():''
        // dialog_nowProduce.startTime2 = !isNaN(new Date(dialog_nowProduce.startTime2).getTime())?new Date(dialog_nowProduce.startTime2).getTime():''
        // dialog_nowProduce.startTime3 = !isNaN(new Date(dialog_nowProduce.startTime3).getTime())?new Date(dialog_nowProduce.startTime3).getTime():''
//        dialog_nowProduce.duration = !isNaN(new Date(dialog_nowProduce.duration).getTime())?new Date(dialog_nowProduce.duration).getTime():''
        dialog_nowProduce.finalTime = !isNaN(new Date(dialog_nowProduce.finalTime).getTime())?new Date(dialog_nowProduce.finalTime).getTime():''
        dialog_nowProduce.estimateFinishTime = !isNaN(new Date(dialog_nowProduce.estimateFinishTime).getTime())?new Date(dialog_nowProduce.estimateFinishTime).getTime():''//new Date(dialog_nowProduce.estimateFinishTime).getTime()//这个会做修改
        dialog_nowProduce.estimateStartTime =  !isNaN(new Date(dialog_nowProduce.estimateStartTime).getTime())?new Date(dialog_nowProduce.estimateStartTime).getTime():''

        // console.log('上传的数据')
        // console.log(dialog_nowProduce.estimateFinishTime)
        // console.log(isNaN(dialog_nowProduce.estimateFinishTime))
        // console.log(dialog_nowProduce)
        if (!dialog_nowProduce.estimateFinishTime||dialog_nowProduce.estimateFinishTime<0) {
          util.showErrorToast(this.$getTextByLangKey('日期格式有误，请重新输入'))
        }else{
          request.requestSaveNowProduce(dialog_nowProduce, res => {
            util.showSuccessToast(this.$getTextByLangKey('修改成功'))
            // console.log(res.data.data.list[0])
            this.$emit("updateNowProduce", res.data.data.list[0])
          })
          this.nowProduce_dialogVisible = false;
        }

//        console.log(dialog_nowProduce)
//        if (isNaN(dialog_nowProduce.estimateFinishTime)) {
//          util.showErrorToast('日期格式有误，请重新输入')
//        } else {
//
//        }
      },


      openNowDialog: function () {
        this.dialog_nowProduce = util.deepCopy(this.nowProduce)
      },

      openWaitDialog: function () {
        this.dialog_waitProduce = util.deepCopy(this.waitProduce)
      }
    }
  }

</script>

<style lang="stylus">
  .el-dialog__body {
    padding-top: 10px;
    padding-bottom: 0px;
  }

  .el-dialog__footer {
    padding-top: 10px;
    padding-right 50px

  }

  .avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .avatar-uploader .el-upload:hover {
    border-color: #409EFF;
  }
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 64px;
    height: 64px;
    line-height: 64px;
    text-align: center;
  }
  .avatar {
    width: 64px;
    height: 64px;
    display: block;
  }
</style>

<style scoped lang="stylus">

  .el-dialog__body {
    padding-top: 10px;
    padding-bottom: 0px;
  }

  .el-dialog__footer {
    padding-top: 0px;
  }

  .el-form-left {
    margin-right: 10px;
  }

  .el-form-right {
    margin-left: 10px;
  }

  .action-wrapper.action-wrapper-tv {
    flex-direction row;
  }

  .action-content-tv + .action-content-tv {
    border-left: solid 2px rgb(235, 238, 245);
  }

  .action-wrapper {
    display: flex;
    flex-direction column;
    .action-content {
      width: 100%;
      .action-title {
        display: flex
        padding 15px 20px;
        align-items center
        .center-div {
          flex: 1
        }
        .info-title {
          color: #606266;
          /*cursor: pointer*/
          /*font-size 18px;*/
          /*font-weight 700*/
          .icon {
            margin-left 3px
            color: #606266;
            /*font-weight 700*/
          }

          &:active {
            color: #606266;
            .info-title {

            }
            .icon {
              color: #606266
            }
          }
        }

      }

      .line-data-wrapper {
        display: flex;
        padding 0px 20px 10px 20px

        .line-data + .line-data {
          padding-left 14px;
          border-left: solid 2px rgb(235, 238, 245);
        }
        .line-data {
          flex: 1;
          display: flex;
          flex-direction column;
          .simple {
            padding-top 14px
            padding-bottom 14px;
            :first-child {
              display inline-block
              width 120px
              color: #606266
            }
            :nth-child(2) {
              color: #303133
            }
          }

        }
      }
    }

  }

</style>

